//聊天界面
$chat-room-width: 800px;
$chat-room-height: 600px;
$checked-color: #f2f9ff;
$chat-main-color: #20a6f4;

.chart {
  width: 100%;
  height: 100%;
  padding: 15px;
}

.chart-icon {
  position: fixed;
  right: 50px;
  bottom: 50px;
  width: 60px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: $chat-main-color;
  border-radius: 50%;
  z-index: 999;
  cursor: pointer;

  .unRead {
    position: absolute;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    line-height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    background-color: rgb(238, 48, 48);
    right: 0;
    bottom: 0;
    font-size: 12px;
    border: 2px solid #fff;
  }

  .icon {
    font-size: 32px;
    color: #fff;
  }

  &:hover {
    box-shadow: 0 0 27px 1.5px rgb(0 0 0 / 20%);
  }
}

// 聊天框
.chart-container {
  width: $chat-room-width;
  height: $chat-room-height;
  position: fixed;
  right: 50px;
  bottom: 140px;
  z-index: 999;
  box-shadow: 0 7px 40px 2px rgba(125, 143, 155, 0.1);
  border-radius: 6px;
  box-sizing: border-box;
  overflow: hidden;
  background-image: linear-gradient(90deg, rgba(255, 0, 0, 0.03) 5%, rgba(72, 42, 10, 0) 0), linear-gradient(1turn, rgba(0, 0, 0, 0.03) 5%, rgba(255, 153, 44, 0) 0);
  background-size: 26px 26px;
  background-color: #f8fcff;
  display: flex;
  flex-direction: column;
  color: #333;

  .c-title {
    width: 100%;
    height: 50px;
    background-color: $chat-main-color;
    position: relative;
    box-shadow: 0px 1px 2px rgb(79, 181, 240), 0px 0px 20px rgb(79, 181, 240) inset;
    box-sizing: border-box;
    padding: 0 15px;
    display: flex;
    align-items: center;
    color: #fff;
    display: flex;
    justify-content: space-between;
  }

  .cont {
    flex: 1;
    display: flex;
    border: 1px dashed #f9f9f9;
    border-top: none;
    // padding: 15px;

    .chat-scroll {
      overflow: hidden;

      // overflow-y: scroll;
      &:hover {
        overflow-y: auto;
      }

      &::-webkit-scrollbar {
        width: 3px;
        height: 2px;
      }

      &::-webkit-scrollbar-track {
        background-color: transparent;
        -webkit-border-radius: 2em;
        -moz-border-radius: 2em;
        border-radius: 2em;
      }

      &::-webkit-scrollbar-thumb {
        background-color: rgb(147, 147, 153, 0.5);
        -webkit-border-radius: 2em;
        -moz-border-radius: 2em;
        border-radius: 2em;
      }

    }

    // 内容
    .friend-cont {
      width: 230px;
      height: $chat-room-height - 50px;
      background-color: rgba(255, 255, 255, 0.8);
      border-radius: 4px;
      box-shadow: 0 3px 10px 2px rgba(125, 143, 155, 0.1);
      box-sizing: border-box;
      font-size: 13px;
      display: flex;
      flex-direction: column;

      .f-title {
        width: 100%;
        height: 40px;
        display: flex;
        align-items: center;
        justify-content: space-between;
        border-bottom: 1px dashed #f7f7f7;
        padding: 0px 10px;
        position: relative;

        .f-icons {
          flex: 1;
          display: flex;
          align-items: center;
          margin-left: 20px;
          box-sizing: border-box;
          padding: 0px 4px;
          border-radius: 4px;
          cursor: pointer;
          background-color: #d8f0f9;

          &:hover {
            background-color: #e7f9ff;
          }

          .icon {
            font-size: 24px;
            color: #fff;
            padding: 6px;

            margin-right: 4px;


          }

          .useSearch {
            width: 100px;
            outline: none;
            border: none;
            border-radius: 4px;
            background-color: #e7f9ff;

            &:hover,
            &:focus-within,
            &:focus,
            &:focus-visible {
              border: none;
              background-color: #e7f9ff;
            }

          }
        }
      }


      .f-list {
        display: flex;
        flex: 1;
        flex-direction: column;

        .f-item-checked {
          background-color: $checked-color;
        }

        .f-item {
          width: 230px;
          height: 60px;
          display: flex;
          align-items: center;
          padding: 10px;
          cursor: pointer;

          &:hover {
            background-color: $checked-color;
          }

          .f-logo {
            position: relative;
            width: 32px;
            height: 32px;

            & img {
              width: 32px;
              height: 32px;
              border-radius: 50%;
              z-index: 998;
            }

            .online-staus {
              position: absolute;
              right: -2px;
              bottom: -2px;
              color: #fff;
              z-index: 999;
              font-size: 14px;
              border-radius: 50%;
              padding: 2px;
              border: 1px solid #fff;
              box-sizing: border-box;
            }

            .on {
              background-color: $chat-main-color;
            }

            .off {
              background-color: #ccc;
            }
          }


          .info,
          .type {
            height: 100%;
            display: flex;
            flex-direction: column;
            justify-content: space-between;

          }

          .type {
            height: 100%;
            align-items: flex-end;
            color: #999;
            font-size: 12px;

            .num {
              width: 14px;
              height: 14px;
              border-radius: 50%;
              background-color: rgb(249, 65, 65);
              margin-right: 10px;
              box-sizing: border-box;
              display: flex;
              align-items: center;
              justify-content: center;
              color: #fff;
              font-size: 12px;
            }
          }

          .info {
            flex: 1;
            padding: 0px 10px;
            min-width: 0;

            .name {
              font-size: 14px;
              font-weight: bold;
            }

            .text {
              width: 100%;
              font-size: 12px;
              color: #666;
              overflow: hidden;
              text-overflow: ellipsis;
              white-space: nowrap;
            }
          }
        }
      }
    }

    //聊天
    .chat-rest {
      flex: 1;
      padding-left: 10px;
      display: flex;
      flex-direction: column;

      .mes-status {
        width: 100%;
        height: 40px;
        box-sizing: border-box;
        border-bottom: 1px dashed #f7f7f7;
        display: flex;
        align-items: center;

        .mes-status-child {
          width: 100%;
          display: flex;
          align-items: center;

          .name {
            font-weight: bold;
          }

          .line {
            width: 8px;
            height: 8px;
            background-color: #20a6f4;
            border-radius: 50%;
            margin-left: 20px;
          }

          .offline {
            margin-left: 20px;
            font-size: 13px;
            color: #999;
          }
        }
      }

      .message-box {
        position: relative;
        width: 100%;
        height: $chat-room-height - 170px;

        .mes-loading {
          position: absolute;
          top: 0px;
          left: 0px;
          width: 100%;
          text-align: center;
          line-height: 10px;
        }

        .mes-body {
          width: 528px;
          margin-left: 10px;

          .mes-item {
            width: 100%;
            height: auto;
            display: flex;
            align-items: flex-start;
            margin-bottom: 10px;

            .mes-tip {
              width: 100%;
              height: 100%;
              min-height: 60px;
              display: flex;
              align-items: center;
              justify-content: center;
              font-size: 13px;
              color: #999;
            }

            .headpic {
              width: 32px;
              height: 32px;
              border-radius: 50%;
            }

            .mes-cont {
              padding-top: 4px;
              max-width: 70%;
              height: auto;


              .mes-time {
                color: #999;
                font-size: 12px;
              }

              .mes-info {
                word-wrap: break-word;
                word-break: break-all;
                position: relative;
                margin-top: 4px;
                border-radius: 10px;
                min-height: 40px;
                box-sizing: border-box;
                padding: 10px 20px;
                font-size: 14px;
                color: #333;
                display: inline-block;

              }

              .mes-info::before {
                content: " ";
                position: absolute;
                right: 100%;
                top: 10px;
                margin-top: -2px;
                border: 10px solid transparent;
              }
            }
          }
        }

        .mes-left {

          .headpic {
            margin-right: 10px;
          }

          .mes-cont {
            .mes-info {
              word-wrap: break-word;
              word-break: break-all;
              background-color: #fff;
              box-shadow: 0 3px 10px 2px rgba(88, 174, 231, 0.2);
              border: 1px solid rgba(88, 174, 231, 0.2);

              &::before {
                border-right-color: #ffffff;
              }

              .mes-file {
                display: flex;
                background-color: #fff;
                width: 250px;
                height: 60px;
                justify-content: center;
                align-items: center;

                .mes-file-left {
                  width: 190px;
                }

                .mes-file-right {
                  width: 30px;
                  margin-left: 20px;
                }
              }
            }
          }
        }

        .mes-right {
          flex-direction: row-reverse;

          .headpic {
            margin-left: 10px;
          }

          .mes-cont {
            display: flex;
            flex-direction: column;
            align-items: flex-end;

            .mes-info {
              color: #fff;
              background-color: $chat-main-color;
              box-shadow: 0 3px 10px 2px rgba(78, 175, 240, 0.2);
              border: 1px solid rgba(88, 174, 231, 0.2);

              &::before {
                left: 100%;
                border-left-color: $chat-main-color;
              }

              .mes-file {
                display: flex;
                background-color: #fff;
                width: 250px;
                height: 60px;
                justify-content: center;
                align-items: center;

                .mes-file-left {
                  width: 190px;
                }

                .mes-file-right {
                  width: 30px;
                  margin-left: 20px;
                }
              }
            }

          }
        }
      }

      .input-area {
        width: 100%;
        height: 80px;
        background-color: #fff;
        border-radius: 4px;
        box-shadow: 0 3px 10px 2px rgba(125, 143, 155, 0.1);
        display: flex;
        align-items: center;
        position: relative;

        .upload {
          display: flex;
          align-items: center;
          margin: 0px 4px;

          .icon {
            font-size: 30px;
            color: $chat-main-color;
            cursor: pointer;
            padding: 3px;

            &:hover {
              background-color: $checked-color;
            }
          }
        }

        .sub-input {
          width: $chat-room-width - 370px;
          border: 1px solid $checked-color;
          height: 60px;
          overflow-y: scroll;
          box-sizing: border-box;
          padding: 5px;
          outline: none;
          border-radius: 4px;

          &::-webkit-scrollbar {
            width: 0 !important
          }

          &:focus-within,
          &:focus,
          &:focus-visible {
            border: 1px solid $chat-main-color;
            box-sizing: border-box;
          }
        }

        .sub-btn {
          width: 40px;
          height: 40px;
          background-color: $chat-main-color;
          border-radius: 50%;
          display: flex;
          align-items: center;
          justify-content: center;
          margin-left: 10px;
          box-shadow: 0 3px 10px 2px rgba(125, 143, 155, 0.1);
          cursor: pointer;

          .icon {
            color: #fff;
            font-size: 30px;
          }
        }
      }

    }
  }


}




.wobble-hor-top {
  -webkit-animation: wobble-hor-top 1s infinite both;
  animation: wobble-hor-top 1s infinite both;
}

@-webkit-keyframes wobble-hor-top {

  0%,
  100% {
    -webkit-transform: translateX(0%);
    transform: translateX(0%);
    -webkit-transform-origin: 50% 50%;
    transform-origin: 50% 50%;
  }

  15% {
    -webkit-transform: translateX(-5px) rotate(6deg);
    transform: translateX(-5px) rotate(6deg);
  }

  30% {
    -webkit-transform: translateX(2px) rotate(-6deg);
    transform: translateX(2px) rotate(-6deg);
  }

  45% {
    -webkit-transform: translateX(-2px) rotate(3.6deg);
    transform: translateX(-2px) rotate(3.6deg);
  }

  60% {
    -webkit-transform: translateX(1px) rotate(-2.4deg);
    transform: translateX(1px) rotate(-2.4deg);
  }

  75% {
    -webkit-transform: translateX(-1px) rotate(1.2deg);
    transform: translateX(-1px) rotate(1.2deg);
  }
}

@keyframes wobble-hor-top {

  0%,
  100% {
    -webkit-transform: translateX(0%);
    transform: translateX(0%);
    -webkit-transform-origin: 50% 50%;
    transform-origin: 50% 50%;
  }

  15% {
    -webkit-transform: translateX(-5px) rotate(6deg);
    transform: translateX(-5px) rotate(6deg);
  }

  30% {
    -webkit-transform: translateX(2px) rotate(-6deg);
    transform: translateX(2px) rotate(-6deg);
  }

  45% {
    -webkit-transform: translateX(-2px) rotate(3.6deg);
    transform: translateX(-2px) rotate(3.6deg);
  }

  60% {
    -webkit-transform: translateX(1px) rotate(-2.4deg);
    transform: translateX(1px) rotate(-2.4deg);
  }

  75% {
    -webkit-transform: translateX(-1px) rotate(1.2deg);
    transform: translateX(-1px) rotate(1.2deg);
  }
}


// 搜索结果
.search-result-box {
  position: absolute;
  width: 100%;
  height: 510px;
  z-index: 1001;
  left: 0;
  top: 40px;
  background-color: #fff;
  box-shadow: 0 3px 10px 2px rgba(125, 143, 155, 0.1);
  box-sizing: border-box;
  padding: 10px;

  .sr-list {
    width: 230px;
    height: 510px;

    .sr-item:hover {
      background-color: #d8f0f9;
    }

    & div:last-child {
      border-bottom: none;
    }

    .sr-item {
      width: 100%;
      display: flex;
      align-items: center;
      padding: 10px 10px;
      height: auto;
      border-bottom: 1px solid #f2f2f2;
      cursor: pointer;


      .usr-logo {
        width: 32px;
        height: 32px;
        border-radius: 50%;
      }

      .usr-info {
        flex: 1;
        margin-left: 10px;
        display: flex;
        flex-direction: column;

        .usr-name {
          width: 100%;
          display: flex;
          font-size: 14px;
          font-weight: bold;
          align-items: center;

          .usr-dept {
            display: flex;
            margin-left: 10px;
            align-items: center;
            overflow: hidden;
            padding: 4px 0px;

            & span {
              margin: 0 5px;
            }

            & span:first-of-type {
              margin: 0px 5px 0px 0px;
            }
          }
        }

        .usr-role {
          font-size: 12px;
          color: #999;
        }
      }
    }
  }
}